E1:

Using data from 'https://raw.githubusercontent.com/mengluchu/uncertainty/master/data_vis_exp/DENL17_uc.csv'

  1. Plot the spatial points for one of the variables from the dataframe, e.g. "wnd_day_value", add your favorate basemap.
  2. Calculate global Moran's I using KNN, does the result differ with k equal to 4, 5, and 8?
  3. Calculate local Moran's I using KNN, does the result differ with k equal to 4, 5, and 8?

E2:

(optional) further read: Global Spatial Autocorrelation

E1

Inspecting dataset

To decide on which variable to use.

Visual inspection

Load the dataset as a geo referenced geopandas dataframe

Plotting could be achieved like this.

Doesn't look nice although a grey background helps in differentiating hues, but anyway it gives an idea what we can do. And as we're trying to find an interesting data column, it would be nice to look at them im groups. Fortunately, we can collect columns starting with a certain string..

We can also get a statistical overview of those columns, sorted alphabetically.

And it could be helpful to know the members of a categorical column, e.g. "urbantype_chara".

Let's wrap this up into a function that takes the geopandas dataframe and a keyword for the columns we're interested in.

And plot along..

So when .describe() only has categorical data, it suddenly displays those.

The size of the legend bounces, unfortunately. And Munich seems to outrule Berlin if displayed this way, will have to look into pyplot's use of symbols at some time.

Industry_buffer is industrial area in different buffer rings, according to the source. TODO: Could be helpful to rename the buffer size to a four digit zero filled one, so the sorting and display of the plots becomes easier to understand.

These are very interesting!

Also nightlight_450 and nightlight_900 look like good candidates.

Something seems to get cached when plotting, at least on a notebook. Will have to find a reset-those-values function some time.

Anyway, now I've decided on one variable:

1.)

Plot the spatial points for one of the variables from the dataframe, e.g. "wnd_day_value", add your favorate basemap.

Ok now let's quickly look for a basemap.

That seems like an interesting correlation right there with "wkd_day_value", and funny enough I actually decided on the nightlight_450 and nightlight_900.

Scheme seems to closely match the background. No idea how to get green circles around the spots in the legend, though.

And a look at the quantiles in use:

2.)

Calculate global Moran's I using KNN, does the result differ with k equal to 4, 5, and 8?

Try them all..

does the result differ with k equal to 4, 5, and 8??!!!

Yes it differs, not very much but a bit more than with wkd_day_value.

3.)

Calculate local Moran's I using KNN, does the result differ with k equal to 4, 5, and 8?

If. The. Result. Differs with k equal to 4, 5, and 8 !!1!

Not sure what to make of these values? The values indicating quandrant location: 1 HH, 2 LH, 3 LL, 4 HL hardly change though, as can be seen comparing loop_local_moran_I_KNN.q .